package com.xhblogs.book.service;

import com.github.pagehelper.PageInfo;
import com.xhblogs.book.pojo.Book;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public interface BookService {
    /**
     * 查询所有
     * @return
     */
    List<Map<String,Object>> getAll();

    PageInfo<Map<String,Object>> getPageBook(Integer page, Integer pageSize);


    /**
     * 根据名称模糊查询
     * @return
     */
    List<Map<String,Object>> getLike(@Param("name") String name);

    List<Map<String,Object>> getCategoryIdBooks(@Param("id") int id);
    Book getIdBook(@Param("id") int id);
    /**
     * 更新book
     * @param book
     * @return
     */
    int updateBook(Book book);

    /**
     * 添加图书
     * @param book
     * @return
     */
    int addBook(Book book);

    /**
     * 修改图书根据id
     * @param id
     * @return
     */
    int deleteBook(@Param("id") int id);
}
